﻿@model IEnumerable<HdipCricketClub.Models.Team>

@{
    ViewBag.Title = "Teams";
}

<h2>@ViewBag.Title</h2>

<p>
    @Html.ActionLink("Add a New Team", "Create")
</p>
<table>
    <tr>
        <th>
            Name:
        </th>
        <th>
            Captain:
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Member.first_name) @Html.DisplayFor(modelItem => item.Member.last_name)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.team_id }) |
            @Html.ActionLink("Details", "Details", new { id=item.team_id }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.team_id })
        </td>
    </tr>
}

</table>
